package com.study.mike.model.query;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author KangHui
 * @Date 2023/9/20 17:17
 */
@Data
public class ContractQuery {
    /**
     * 主键
     */
    private Long id;

    /**
     * contract_name
     */
    private String contractName;

    /**
     * contract_type
     */
    private Integer contractType;

    /**
     * flow_no
     */
    private String flowNo;

    /**
     * contract_no
     */
    private String contractNo;

    /**
     * location_no
     */
    private String locationNo;

    /**
     * cooperation_mode
     */
    private Integer cooperationMode;

    /**
     * project_leader
     */
    private String projectLeader;

    /**
     * sign_time-start
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startSignTime;

    /**
     * sign_time-end
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endSignTime;

    /**
     * expire_time-start
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startExpireTime;


    /**
     * expire_time-end
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endExpireTime;

    /**
     * amount_type
     */
    private Integer amountType;

    /**
     * contract_object
     */
    private String contractObject;


    /**
     * first_party_name
     */
    private String firstPartyName;

    /**
     * first_party_type
     */
    private Integer firstPartyType;

    /**
     * trade_type
     */
    private Integer tradeType;

    /**
     * contacts
     */
    private String contacts;

    /**
     * contacts_mobile
     */
    private String contactsMobile;

    /**
     * serverScope
     */
    private List<String> serverScope;

    /**
     * detail_address
     */
    private String detailAddress;

    /**
     * attachments_name
     */
    private String attachmentsName;

    /**
     * attachments_path
     */
    private String attachmentsPath;

    /**
     * attachments_suffix
     */
    private String attachmentsSuffix;

    /**
     * company_code
     */
    private String companyCode;

    /**
     * exact_amount-start
     */
    private BigDecimal startExactAmount;

    /**
     * exact_amount-end
     */
    private BigDecimal endExactAmount;

    /**
     * contract_duration-start
     */
    private String startContractDuration;

    /**
     * contract_duration-end
     */
    private String endContractDuration;

    /**
     * 当前页
     */
    private Integer pageCurrent;

    /**
     * 每页数量
     */
    private Integer pageSize;

    /**
     * 所选id集合
     */
    private List<Long> ids;

    /**
     * exportType
     *
     * @return
     */
    private Integer exportType;

    public String getCompanyCode() {
        return companyCode = StrUtil.isBlank(companyCode) ? "1000" : companyCode;
    }

    public Integer getPageCurrent() {
        return pageCurrent = ObjectUtil.isNull(pageCurrent) ? 1 : pageCurrent;
    }

    public Integer getPageSize() {
        return pageSize = ObjectUtil.isNull(pageSize) ? 10 : pageSize;
    }


}
